<template>
  <div>
    <el-tabs v-if="curComponent" v-model="activeName">
      <el-tab-pane label="属性" name="Attr">
        <component :is="curComponent.component + 'Attr'"></component>
      </el-tab-pane>
      <el-tab-pane label="动画" name="animation">动画</el-tab-pane>
      <el-tab-pane label="事件" name="events">
        <component :is="curComponent.component + 'Event'"></component>
      </el-tab-pane>
    </el-tabs>
    <CanvasAttr v-else></CanvasAttr>
  </div>
</template>

<script>
import CanvasAttr from "./CanvasAttr.vue";
import { mapState } from "vuex";

export default {
  data() {
    return {
      activeName: "Attr",
    };
  },
  computed: {
    ...mapState(["curComponent"]),
  },
  components: {
    CanvasAttr,
    Event,
  },
};
</script>

<style lang="less" scoped></style>
